package com.order.action;

import java.util.List;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.order.entity.Goods;
import com.order.service.GoodsService;

@SuppressWarnings("serial")
public class GoodsAction extends ActionSupport {
	//用来存放商品列表，并传递到页面
	private List<Goods> goodsList = null;
	public List<Goods> getGoodsList() {
		return goodsList;
	}
	public void setGoodsList(List<Goods> goodsList) {
		this.goodsList = goodsList;
	}

	/**
	 * 列出所有商品
	 */
	@Override
	public String execute() throws Exception {
		goodsList = (List<Goods>) new GoodsService().getGoodsList();
		return Action.SUCCESS;
	}
	
}
